package com.software.chemistry.controller;

import com.software.chemistry.domain.Result;
import com.software.chemistry.entity.ModelType;
import com.software.chemistry.service.ModelTypeService;
import com.software.chemistry.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/model_type")
public class ModelTypeController {

    @Autowired
    private ModelTypeService modelTypeService;

    @GetMapping("/findAll")
    private Result<ModelType> findAll(){
        List<ModelType> modelTypes = modelTypeService.findAll();
       return ResultUtil.success(modelTypes);
    }
    @GetMapping("/findCommonModelType")
    private Result<ModelType> findCommonModelType(){
        List<ModelType> modelTypes = modelTypeService.findCommonModelType();
        return ResultUtil.success(modelTypes);
    }


}
